﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:windowsToolbar="clr-namespace:Dev.Silverlight.Controls"
    xmlns:windowsToolbar_spezialized="clr-namespace:Dev.Silverlight.Controls.Specialized">
    
	<Style x:Key="SimpleButton" TargetType="ToggleButton">
		<Setter Property="Template">
			<Setter.Value>    	
				<ControlTemplate TargetType="ToggleButton">
		    		<Grid Background="Transparent">
						<ContentPresenter />
		    		</Grid>
		    	</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style TargetType="windowsToolbar:ToolbarGroup">
		<Setter Property="BorderBrush" Value="#AEBECD" />
		<Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Background">
			<Setter.Value>
		    	<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                	<GradientStop Color="#DCE7F4" Offset="0.0" />
                	<GradientStop Color="#D2DFF0" Offset="0.3" />
                	<GradientStop Color="#C7D8ED" Offset="0.30"/>
                	<GradientStop Color="#D8E8F5" Offset="1" />
               	</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="windowsToolbar:ToolbarGroup">
                    <Border CornerRadius="5" Background="White"
                		BorderBrush="{TemplateBinding BorderBrush}" 
                		BorderThickness="{TemplateBinding BorderThickness}">
                		<VisualStateManager.VisualStateGroups>
                			<VisualStateGroup x:Name="CommonStates">
                				<VisualStateGroup.Transitions>
                					<VisualTransition GeneratedDuration="00:00:00.4000000"/>
                				</VisualStateGroup.Transitions>
                				<VisualState x:Name="Normal" />
                				<VisualState x:Name="MouseOver">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#E5EFFD"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#E7F0FC"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#DBE9FB"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#DCE8F8"/>
                						</ColorAnimationUsingKeyFrames>                						
										<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FooterBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#C8E0FF"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FooterBorder" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#D6EDFF"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                			</VisualStateGroup>
                		</VisualStateManager.VisualStateGroups>
                		
                		<Grid>
                			<Grid.RowDefinitions>
                				<RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                			</Grid.RowDefinitions>
							
							<Border x:Name="RootBorder" CornerRadius="4,4,0,0" Margin="1,1,1,0" Background="{TemplateBinding Background}">
                				<ContentPresenter Content="{TemplateBinding Content}" Margin="5,1,5,1"
                					HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="0" />
							</Border>
							
							<Border x:Name="FooterBorder" Grid.Row="1" CornerRadius="0,0,4,4">
								<Border.Background>
							    	<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
					                	<GradientStop Color="#C1DAF1" Offset="0.0" />
					                	<GradientStop Color="#C1DAF1" Offset="1" />
					               	</LinearGradientBrush>
								</Border.Background>
                				<TextBlock HorizontalAlignment="Center" Foreground="#708BBB" Text="{TemplateBinding Footer}"/>
                			</Border>
                		</Grid>
                	</Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
	
    <Style TargetType="windowsToolbar:ToolbarDropDownButton">
        <Setter Property="Padding" Value="2" />
        <Setter Property="CornerRadius" Value="3" />
		<Setter Property="Background" Value="#FFDEE6F2" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#FFB8CAE2" />
		<Setter Property="Height" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="windowsToolbar:ToolbarDropDownButton">
                    <Grid>
                		<VisualStateManager.VisualStateGroups>
                			<VisualStateGroup x:Name="CommonStates">
                				<VisualState x:Name="Normal" />
                				<VisualState x:Name="MouseOver">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFA5"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEC300"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                				<VisualState x:Name="Selecting">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEED900"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEC300"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                				<VisualState x:Name="Pressed">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEED900"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEC300"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                        		<VisualState x:Name="Disabled">
                        			<Storyboard>
                        				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisableBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                        					<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                        				</DoubleAnimationUsingKeyFrames>
                        			</Storyboard>
                        		</VisualState>
                			</VisualStateGroup>
                		</VisualStateManager.VisualStateGroups>						
						
						<Border x:Name="RootBorder" CornerRadius="{TemplateBinding CornerRadius}" 
                            Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}">
							<StackPanel x:Name="ButtonContainer" Orientation="Horizontal">		                		
		                		<Border>
		                			<ContentPresenter Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}" 
										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
		                		</Border>
								
								<Border>
			                		<ToggleButton x:Name="DropDownArrowToggleButton" Style="{StaticResource SimpleButton}" Width="14" Margin="-1">
			                			<Polygon Points="0,0 10,0, 5,3" Fill="Black" Height="4" HorizontalAlignment="Center" />
			                		</ToggleButton>
								</Border>
		                	</StackPanel>
						</Border>
						
						<Border x:Name="DisableBorder" Background="White" Opacity="0" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False" />
					</Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="windowsToolbar:ToolbarButton">
        <Setter Property="Padding" Value="2" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CornerRadius" Value="3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="windowsToolbar:ToolbarButton">
					<Grid>						
                		<VisualStateManager.VisualStateGroups>
                			<VisualStateGroup x:Name="CommonStates">
                				<VisualState x:Name="Normal" />
                				<VisualState x:Name="MouseOver">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFA5"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE8CA41"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                				<VisualState x:Name="Pressed">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEA200"/>
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                							<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEC300"/>
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                        		<VisualState x:Name="Disabled">
                        			<Storyboard>
                        				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                        					<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                        				</DoubleAnimationUsingKeyFrames>
                        			</Storyboard>
                        		</VisualState>
                			</VisualStateGroup>
                		</VisualStateManager.VisualStateGroups>
						
						<Border x:Name="RootBorder" CornerRadius="{TemplateBinding CornerRadius}" Opacity="1" 
							BorderThickness="{TemplateBinding BorderThickness}"
							BorderBrush="{TemplateBinding BorderBrush}"
							Background="{TemplateBinding Background}">
							
		                	<ContentPresenter Content="{TemplateBinding Content}"  Margin="{TemplateBinding Padding}"
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
	                    </Border>
					</Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="windowsToolbar:ToolbarToggleButton">
        <Setter Property="Padding" Value="2" />
        <Setter Property="CornerRadius" Value="3" />
		<Setter Property="Background" Value="#FFDEE6F2" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="#FFB8CAE2" />
		<Setter Property="Height" Value="22" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="windowsToolbar:ToolbarToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                        		<VisualState x:Name="Normal" />
                        		<VisualState x:Name="MouseOver">
                        			<Storyboard>
                        				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                        					<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFA5"/>
                        				</ColorAnimationUsingKeyFrames>
                        				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                        					<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE8CA41"/>
                        				</ColorAnimationUsingKeyFrames>
                        			</Storyboard>
                        		</VisualState>
                        		<VisualState x:Name="Pressed">
                        			<Storyboard>
                        				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                        					<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEA200"/>
                        				</ColorAnimationUsingKeyFrames>
                        				<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RootBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
                        					<EasingColorKeyFrame KeyTime="00:00:00" Value="#FFEEC300"/>
                        				</ColorAnimationUsingKeyFrames>
                        			</Storyboard>
                        		</VisualState>
                        		<VisualState x:Name="Disabled">
                        			<Storyboard>
                        				<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisableBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                        					<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                        				</DoubleAnimationUsingKeyFrames>
                        			</Storyboard>
                        		</VisualState>
                        	</VisualStateGroup>
							<VisualStateGroup x:Name="CheckStates">
								<VisualState x:Name="Unchecked"/>
								<VisualState x:Name="Indeterminate"/>
								<VisualState x:Name="Checked">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="CheckedBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
											<EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

						<Grid>
	                        <Border x:Name="RootBorder" CornerRadius="{TemplateBinding CornerRadius}"
								BorderThickness="{TemplateBinding BorderThickness}"
								BorderBrush="{TemplateBinding BorderBrush}"
								Background="{TemplateBinding Background}">		                			
								
								<Grid>
									<Border x:Name="CheckedBorder" CornerRadius="{TemplateBinding CornerRadius}" Margin="-1" 
										BorderBrush="{TemplateBinding BorderBrush}"
										BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" >
										<Border.Background>
											<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
												<GradientStop Color="#FFFFFFA5" Offset="1"/>
												<GradientStop Color="#FFEED900" Offset="0"/>
											</LinearGradientBrush>
										</Border.Background>
									</Border>
								
									<ContentPresenter Content="{TemplateBinding Content}"  Margin="{TemplateBinding Padding}"
										HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
	                        	</Grid>
							</Border>
							
							<Border x:Name="DisableBorder" Background="White" Opacity="0" CornerRadius="{TemplateBinding CornerRadius}" />
						</Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
